﻿<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <CustomAction Id="CodeCounsel.SharePoint.ApprovalActions"
                Location="CommandUI.Ribbon"
                RegistrationType="List"
                RegistrationId="10000">
    <CommandUIExtension>
      <CommandUIDefinitions>
        <CommandUIDefinition Location="Ribbon.ListItem.Actions.Controls._children">
          <Button
            Id="Ribbon.ListItem.Actions.ApproveSelection"
            Sequence="20"
            Command="ApproveSelection"
            Image16by16="/_layouts/$Resources:core,Language;/images/formatmap16x16.png" Image16by16Top="-144" Image16by16Left="0"
            Image32by32="/_layouts/$Resources:core,Language;/images/formatmap32x32.png" Image32by32Top="-128" Image32by32Left="-256"
            LabelText="Approve Selection" 
            TemplateAlias="o1"/>
        </CommandUIDefinition>
        <CommandUIDefinition Location="Ribbon.ListItem.Actions.Controls._children">
          <Button
            Id="Ribbon.ListItem.Actions.DeleteUnapprovedItems"
            Sequence="25"
            Command="DeleteUnapprovedItems"
            Image16by16="/_layouts/$Resources:core,Language;/images/formatmap16x16.png" Image16by16Top="-192" Image16by16Left="-32"
            Image32by32="/_layouts/$Resources:core,Language;/images/formatmap32x32.png" Image32by32Top="-128" Image32by32Left="-128"
            LabelText="Delete Unapproved"
            TemplateAlias="o1"/>
        </CommandUIDefinition>
      </CommandUIDefinitions>
      <CommandUIHandlers>
        <CommandUIHandler Command="ApproveSelection"
                          CommandAction="javascript:ApproveItems();"
                          EnabledScript="javascript:HasUnapprovedSelectedItems();" />
        <CommandUIHandler Command="DeleteUnapprovedItems"
                          CommandAction="javascript:DeleteUnapprovedItems();"
                          EnabledScript="return true;" />
      </CommandUIHandlers>
    </CommandUIExtension>
  </CustomAction>

  <!--<CustomAction Id="DemoButtonScript"
                Location="ScriptLink"
                ScriptSrc="~site/_layouts/CodeCounsel.CommentsModeration/Scripts.js" />-->
</Elements>
